package com.skivingcloud.admin.sys.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 *  实体类。
 *
 * @author skivingcloud
 * @since 2023-08-28
 */
@Table(value = "sys_station")
public class SysStation implements Serializable {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 版本
     */
    private Integer version;

    /**
     * 岗位编号
     */
    @NotBlank(message = "岗位编号不能为空")
    @Size(max = 255, message = "岗位编号长度不能超过255")
    @Schema(title = "岗位编号")
    private String stationCode;

    /**
     * 岗位名称
     */
    @NotBlank(message = "名称不能为空")
    @Size(max = 1000, message = "更为名称长度不能超过1000")
    @Schema(title = "岗位名称")
    private String stationName;

    /**
     * 简称
     */
    @Size(max = 255, message = "简称长度不能超过255")
    @Schema(title = "简称")
    private String shortName;

    /**
     * 机构id
     */
    @NotBlank(message = "机构ID不能为空")
    @Size(max = 32, message = "机构ID长度不能超过32")
    @Schema(title = "机构ID")
    private String orgId;

    /**
     * 状态1-正常,2-禁用,3-删除
     */
    @Schema(title = "状态，字典100101")
    private String status;

    /**
     * 排序
     */
    @Min(value = 0, message = "排序不能小于0")
    @Max(value = 99999, message = "排序不能大于99999")
    @Schema(title = "排序")
    private Integer orderNum;

    /**
     * 扩展分类例如:1-总经理、2-副总经理、3-分管领导、4-部门经理、5部门副经理、6-员工、9-其他
     */
    @Size(max = 6, message = "扩展分类长度不能超过6")
    @Schema(title = "扩展分类")
    private String stationRank;

    /**
     * 创建人
     */
    @Schema(title = "创建人")
    private String creater;

    /**
     * 创建时间
     */
    @Schema(title = "创建时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 最后修改人
     */
    @Schema(title = "最后修改人")
    private String modUser;

    /**
     * 修改时间
     */
    @Schema(title = "修改时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime modTime;

    /**
     * 租户
     */
    private String tenantId;
    
    /**
     * 资源权限
     */
    @Column(ignore = true)
    private String[] resId;
    
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getStationCode() {
        return stationCode;
    }

    public void setStationCode(String stationCode) {
        this.stationCode = stationCode;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getStationRank() {
        return stationRank;
    }

    public void setStationRank(String stationRank) {
        this.stationRank = stationRank;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getModUser() {
        return modUser;
    }

    public void setModUser(String modUser) {
        this.modUser = modUser;
    }

    public LocalDateTime getModTime() {
        return modTime;
    }

    public void setModTime(LocalDateTime modTime) {
        this.modTime = modTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }
    
    public String[] getResId(){
        return resId;
    }
    
    public void setResId(String[] resId){
        this.resId = resId;
    }
}
